home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 14 / alite110.zip / LHARC.MAN < prev    next >
Text File  |  1989-05-31  |  41KB  |  1,320 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.       User's Manual for High-Performance File-Compression Program
  10.  
  11.                           LHarc Version 1.13c
  12.                                 05/31/89
  13.  
  14.            Copyright (c) Haruyasu Yoshizaki (Yoshi), 1988-89
  15.  
  16.                                                     Nifty Serve PFF00253
  17.                                                     ASCII PCS   pcs02846
  18.  
  19. ------------------------------------------------------------------------
  20.  
  21. 0. It Came to Pass One Day...
  22.  
  23.    After reading "A Hard Disk Cookbook" from Shouei Press, I had a
  24.    strong desire to write my own archiving utility.  On the Nifty Serve
  25.    network, I was first exposed to Mr. Miki's Larc, which surpasses the
  26.    well-known PKware in compression ratios, as reported in the Forum
  27.    Software Debut and Review.  The next shock came when I saw Mr.
  28.    Okumura's LZari, which has even better compression-ratio performance.
  29.    I started to rewrite LZari in assembly language, trying to make it
  30.    run faster, but I could find hardly no good way to speed up the
  31.    process of un-archiving.
  32.  
  33.    So, as an alternative, I used adaptive Huffman coding with an LZSS
  34.    encoder in order to achieve similar compression ratios with shorter
  35.    decompression times.  This is the idea used in LHarc.
  36.  
  37.    No one can be sure of eradicating all possible bugs, yet if SPACE is
  38.    more valuable than TIME to you, please give this program a try.  It
  39.    may be slower in execution, but it achieves the tightest compression
  40.    ratios of any general archiver in the present "shareware" environ-
  41.    ment.
  42.  
  43.    (Copyright reserved).
  44.  
  45.  
  46. 1. How to Use It:
  47.  
  48.    Just type "LHarc" to see a concise help screen of the program's
  49.    command structure.
  50.  
  51.  
  52.    Command-line synopsis:
  53.    ======================
  54.  
  55.    LHarc [<command>] [{{/|-}{<switch>[-|+|2|<option>]}}...] <archive_name>
  56.          [{<drive_name>:}|{<home_directory_name>\}] [<path_name> ...]
  57.  
  58.    Only a single command can be specified on the command line, but a
  59.    group of switches can be specified together after the '/' or '-'
  60.    delimiter.  You may place switch(es) anywhere following the command.
  61.  
  62.    Hitting 'Ctrl-Break' or 'Ctrl-C' at any time will abort LHarc's
  63.    current operation and return you to the DOS prompt.
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. LHarc User's Manual                                               page 2
  73.  
  74.  
  75.  
  76.    Terminology:
  77.    ============
  78.  
  79.    A path name comprises a directory name and a file name:
  80.  
  81.         a:\tc\include\stdio.ext
  82.         |<---- Path_name ---->|
  83.         |<Directory_>||<File_>|
  84.         |<-- name -->||<name >|
  85.  
  86.    Both the archive name and file name(s) specified in the command line
  87.    can optionally include a path i.e., a drive or directory name.  If
  88.    LHarc becomes excessively confused by your typing, it will just stop
  89.    and wait for keyboard input.  Hit 'CTRL-Break' or 'CTRL-C' to escape
  90.    back to the prompt and then use the DOS function keys to edit and
  91.    reenter your command line.  LHarc will continue to answer your
  92.    request.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. LHarc User's Manual                                               page 3
  102.  
  103.  
  104.  
  105.    Commands:
  106.    =========
  107.  
  108.    a (Add files to archive)
  109.  
  110.      LHarc a ARCHIVE.LZH file1.ext
  111.  
  112.         Adds 'file1.ext' to 'ARCHIVE.LZH'.  If 'ARCHIVE.LZH' does
  113.         not exist, then LHarc will create it.  If a file with the
  114.         name 'file1.ext' already exists in the archive, LHarc will
  115.         replace it with the specified file.
  116.  
  117.         Including the extension '.LZH' with the archive name is
  118.         optional and LHarc will default to using it unless you
  119.         specify otherwise (see below under "Archive name").
  120.         However, you would certainly need to include the extension
  121.         (or just '.' for a blank extension) with any single-
  122.         character archive name or file name that might look like
  123.         one of LHarc's commands.
  124.  
  125.  
  126.  
  127.    u (Update files to archive)
  128.  
  129.      LHarc u ARCHIVE.LZH file1.ext
  130.  
  131.         Adds 'file1.ext' to 'ARCHIVE.LZH', the same as with the 'a'
  132.         command.  However, if 'file1.ext' already exists in the
  133.         archive, LHarc will check its time stamp and will keep the
  134.         newer one and ignore the older one.  (Use the /c switch to
  135.         tell LHarc to skip this time-stamp comparison.)
  136.  
  137.  
  138.    m (Move new files into archive)
  139.  
  140.      LHarc m ARCHIVE.LZH file1.ext
  141.  
  142.         is equivalent to
  143.  
  144.      LHarc u ARCHIVE.LZH file1.ext
  145.      DEL file1.ext
  146.  
  147.         Beware the fact that the second line is implicit.  You might
  148.         lose 'file1.ext' forever.
  149.  
  150.    f (Freshen files in archive)
  151.  
  152.      LHarc f ARCHIVE.LZH file1.ext
  153.  
  154.         Replaces 'file1.ext' in 'ARCHIVE.LZH' with the newer one
  155.         only if a file with this name already exists in the archive.
  156.         Otherwise, no action is taken.  (Use the /c switch to tell
  157.         LHarc to skip this time-stamp comparison.)
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166. LHarc User's Manual                                               page 4
  167.  
  168.  
  169.  
  170.    e or x (EXtract files from archive)
  171.  
  172.      LHarc e ARCHIVE.LZH d:\temp\
  173.  
  174.         Extracts all the files from 'ARCHIVE.LZH
  175.         directory \temp\ on drive D:.  If the specified directory
  176.         does not exist, then LHarc will prompt you whether to create
  177.         it with the message "Make directory? [Y/N]".  If no home
  178.         directory name is specified, LHarc will extract all files to
  179.         the current directory.
  180.  
  181.      LHarc e ARCHIVE.LZH file1.ext
  182.  
  183.         Extracts only 'file1.ext' from 'ARCHIVE.LZH'.  If a file
  184.         with the name 'file1.ext' exists in the home directory,
  185.         LHarc will compare their time stamps and if the existing
  186.         file is older, then LHarc will prompt you whether to
  187.         overwrite it.  (Use the /c switch to tell LHarc to skip this
  188.         time-stamp comparison.)
  189.  
  190.      LHarc e ARCHIVE.LZS file.ext
  191.  
  192.         Extracts 'file.ext' from an .LZS file archived with Larc
  193.         3.xx.
  194.  
  195.         Note:  Larc is another popular archiver on Japanese PDS's.
  196.  
  197.  
  198.    p (disPlay files in archive)
  199.  
  200.      LHarc p ARCHIVE.LZH file1.ext
  201.  
  202.         Extracts 'file1.ext' from 'ARCHIVE.LZH' and redirects it to
  203.         standard output.
  204.  
  205.      LHarc p /v ARCHIVE.LZH file1.ext
  206.  
  207.         Uses the default utility LESS to format and display the
  208.         redirected output.  LHarc creates a temporary file
  209.         'LHARC.TMP' for viewing.  It will be deleted afterward.
  210.  
  211.      LHarc p /vsee ARCHIVE.LZH file1.ext
  212.  
  213.         Invokes the text formatter SEE, which then displays
  214.         'file1.ext' to standard output in a paged format.  Refer to
  215.         PC-LESS.ARC, LIST64A.ARC and SEE15.ARC.  (These should be
  216.         available in most BBS libraries.)
  217.  
  218.  
  219.    d (Delete files from archive)
  220.  
  221.      LHarc d ARCHIVE.LZH file1.ext
  222.  
  223.         Deletes 'file1.ext' from 'ARCHIVE.LZH'.
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232. LHarc User's Manual                                               page 5
  233.  
  234.  
  235.  
  236.    l (List files in archive)
  237.  
  238.      LHarc l ARCHIVE.LZH
  239.  
  240.         Lists information about all the files in 'ARCHIVE.LZH':
  241.         name, original size, stored size, compression ratio, date
  242.         and time, attributes, compression type (see below under
  243.         "Archive File Header") and CRC check.  Each file takes one
  244.         line of output.  A '+' before a file name indicates that a
  245.         directory name is stored with the file name.  (Use the /x
  246.         switch to tell LHarc to also display these directory names.)
  247.  
  248.         If you specify any file names and extensions, then only the
  249.         files with matching names or extensions will be listed:
  250.  
  251.      LHarc l ARCHIVE.LZH *.c *.h readme.doc
  252.  
  253.         Lists information on all the .C, .H and README.DOC files
  254.         in 'ARCHIVE.LZH'.
  255.  
  256.  
  257.    v (View list of files in archive)
  258.  
  259.      LHarc v ARCHIVE.LZH
  260.  
  261.         Which is equivalent to:
  262.  
  263.      LHarc l /x ARCHIVE.LZH
  264.  
  265.         Lists information about all the files in 'ARCHIVE.LZH',
  266.         except that each listing takes two lines: the first for the
  267.         full path name and the second for the rest of the
  268.         information.  The /x switch tells LHarc to display file
  269.         names extended with directory names.
  270.  
  271.  
  272.    s (make Self-extracting archive)
  273.  
  274.      LHarc s ARCHIVE.LZH d:\temp\
  275.  
  276.         Creates a "small" self-extracting file 'ARCHIVE.COM' (or
  277.         'ARCHIVE.EXE' if larger than 64K) from 'ARCHIVE.LZH' in the
  278.         directory \temp\ on drive D:.  If no home directory name is
  279.         specified, then LHarc will create this file in the current
  280.         directory.
  281.  
  282.         A "small" self-extracting archive (SFX) can be as large as
  283.         DOS' working memory space (640K), but normally no larger
  284.         than about 400K for safety.  A "large" SFX, however, is
  285.         limited only by available disk storage (see below under
  286.         "Self-Extracting Archives").
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295. LHarc User's Manual                                               page 6
  296.  
  297.  
  298.  
  299.      LHarc s /x ARCHIVE.LZH
  300.  
  301.         Creates a "large" self-extracting file 'ARCHIVE.EXE' from
  302.         'ARCHIVE.LZH'.  The /x switch tells LHarc to use the
  303.         "large" (extended) SFX model.
  304.  
  305.  
  306.    t (Test integrity of archive)
  307.  
  308.      LHarc t ARCHIVE.LZH
  309.  
  310.         Tests the integrity of 'ARCHIVE.LZH' by running a CRC check
  311.         on each file and comparing the result against the file's
  312.         stored CRC value.
  313.  
  314.  
  315.    (no command specified)
  316.  
  317.      LHarc ARCHIVE.LZH
  318.  
  319.         Acts exactly the same as the 'l' command.  This optional
  320.         action is temporary.  Don't count on it in future versions.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329. LHarc User's Manual                                               page 7
  330.  
  331.  
  332.  
  333.    Switches:
  334.    =========
  335.  
  336.    Specify switch(es) following the switch delimiter '/' or '-'.  If
  337.    you want to specify more than one switch, type characters
  338.    continuously without any intervening spaces, like "/rx-we:\work" or
  339.    "/cxvless".  When the 'v' and 'w' switches are used with other
  340.    switches, they must be specified at the end of a sequence, as shown
  341.    in the above examples.
  342.  
  343.    You may place a '+' or '-' sign after switches, with the following
  344.    meanings: '+' turns the switch on and '-' turns the switch off.
  345.    The '2' creates a special option for the /r and /v switches (see
  346.    below).  If you just specify /<switch> without '+' or '-', then
  347.    <switch> will be toggled from 'on' to 'off' or vice versa, e.g., to
  348.    override any switch set in an environment variable (see below).
  349.  
  350.    NOTE:  Use only lowercase letters for switches.  Capital letters
  351.           are reserved for future use.
  352.  
  353.  
  354.      /x[-|+] (allow eXtended file names)
  355.  
  356.         By default, LHarc stores only the file names of archived
  357.         files and disregards the names of the directory(s) in which
  358.         they reside.  This switch tells LHarc to extend all file
  359.         names with directory names and to extract archived files
  360.         together with their stored directory names.
  361.  
  362.         Example: Suppose you are in the root directory, \ and you
  363.         have two files 'stat.h' and '\tc\include\sys\stat.h':
  364.  
  365.      LHarc a ARCHIVE.LZH stat.h
  366.  
  367.         Adds only the file 'stat.h' from the current (root)
  368.         directory to 'ARCHIVE.LZH', but
  369.  
  370.      LHarc a ARCHIVE.LZH stat.h \tc\include\sys\stat.h
  371.  
  372.         Will cause LHarc to abort with the message "Same names in
  373.         another path", because directory names are normally
  374.         disregarded when storing file names.  However,
  375.  
  376.      LHarc a /x ARCHIVE.LZH stat.h \tc\include\sys\stat.h
  377.  
  378.         Adds both files to 'ARCHIVE.LZH'.  Then,
  379.  
  380.      LHarc e ARCHIVE.LZH stat.h
  381.  
  382.         Extracts both 'stat.h' files to the current directory and
  383.         compares their time stamps and if one is newer, then LHarc
  384.         will prompt you with the message "'STAT.H': Already exists.
  385.         Overwrite? [Y/N]".
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. LHarc User's Manual                                               page 8
  395.  
  396.  
  397.  
  398.      LHarc e /x ARCHIVE.LZH stat.h
  399.  
  400.         Extracts both 'stat.h' files together with their directory names:
  401.         one to the current directory and the other to the directory
  402.         \tc\include\sys\.  If this directory does not exist, then LHarc
  403.         will prompt you whether to create it.
  404.  
  405.         You can also use the /r switch to tell LHarc to archive all
  406.         files with the same file name by recursively searching
  407.         directories.  Thus,
  408.  
  409.      LHarc a /r ARCHIVE.LZH stat.h
  410.  
  411.         Adds two 'stat.h' files, with path names, to 'ARCHIVE.LZH':
  412.         one from the root directory and the other from the directory
  413.         \tc\include\sys\.
  414.  
  415.         The /r switch sets the /x switch simultaneously.  If you
  416.         don't want full path names, include /x- after specifying the
  417.         /r switch.
  418.  
  419.      LHarc s /x ARCHIVE.LZH
  420.  
  421.         Creates the "large" (= extended) self-extracting archive
  422.         'ARCHIVE.EXE' from 'ARCHIVE.LZH' (see below under "Self-
  423.         Extracting ARCHIVEs").
  424.  
  425.  
  426.      /p[-|+] (distinguish full Path names)
  427.  
  428.         By default, LHarc disregards directory names when extracting
  429.         files.  This switch tells LHarc to distinguish files by full
  430.         path name during un-archiving.
  431.  
  432.         Example: Suppose your archive 'tc.LZH' contains both
  433.         'stat.h' and 'sys\stat.h'.  Then,
  434.  
  435.      LHarc e tc stat.h
  436.  
  437.         Extracts both 'stat.h' files to the current directory and
  438.         the older one will be overwritten by the newer one, whereas
  439.  
  440.      LHarc e /p tc stat.h
  441.  
  442.         Extracts only 'stat.h' to the current directory and ignores
  443.         'sys\stat.h', because its path name is not specified.
  444.  
  445.         If you specify full path names without the /p switch, LHarc
  446.         will extract only those files from your archive, but
  447.         otherwise it will disregard stored directory names.  (If you
  448.         want to extend file names with directory names, use the /x
  449.         switch.)
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458. LHarc User's Manual                                               page 9
  459.  
  460.  
  461.      LHarc e tc sys\stat.h
  462.  
  463.         Extracts only 'sys\stat.h' to the current directory.
  464.  
  465.  
  466.      /c[-|+] (skip time-stamp Comparison)
  467.  
  468.      LHarc [e|f|u|x] /c ARCHIVE.LZH [file1.ext file2.ext ...]
  469.  
  470.         If a file with the same name is to be created, LHarc will
  471.         default to comparing the time stamp of each pair of files,
  472.         and so some files will be overwritten and some just ignored.
  473.         This switch tells LHarc to overwrite any existing files with
  474.         extracted ones with the same name.
  475.  
  476.  
  477.      /m[-|+] (no Message for query)
  478.  
  479.      LHarc [<command>] /m ARCHIVE.LZH [file1.ext file2.ext ...]
  480.  
  481.         By default, before operations that alter files or
  482.         directories, LHarc will query you with messages like
  483.         "Overwrite? [Y/N]".  This switch suppresses these messages
  484.         and tells LHarc to proceed as if "y" is typed in.
  485.  
  486.  
  487.      /a[-|+] (allow any Attribute of files)
  488.  
  489.      LHarc a /a ARCHIVE.LZH file1.arc
  490.  
  491.         adds 'file1.arc' to 'ARCHIVE.LZH'.
  492.  
  493.         By default, LHarc will not archive files with the hidden,
  494.         read-only or system attribute.  This switch tells LHarc
  495.         also to archive files with these attributes.
  496.  
  497.  
  498.      /r[-|+|2] (Recursively collect files)
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507. LHarc User's Manual                                              page 10
  508.  
  509.  
  510.  
  511.      LHarc has three modes of collecting the files to be archived:
  512.  
  513.         (a) specified file(s):  /r-
  514.  
  515.             LHarc a /r- ARCHIVE.LZH file1.ext [file2.ext ...]
  516.  
  517.                  Adds to 'ARCHIVE.LZH' only the specified files
  518.                  (default mode).
  519.  
  520.         (b) across directories:  /r or /r+
  521.  
  522.             LHarc a /r ARCHIVE.LZH *.c
  523.  
  524.                  Adds to 'ARCHIVE.LZH' all the files with
  525.                  extension .C on the current drive, starting
  526.                  from the current directory.  LHarc will store
  527.                  all file names extended with directory names.
  528.                  Use this switch to archive all versions of a
  529.                  file or all files of a certain type.
  530.  
  531.         (c) specified directory(s):  /r2
  532.  
  533.             LHarc a /r2 ARCHIVE.LZH \doc
  534.  
  535.                  Adds to 'ARCHIVE.LZH' all the files in the
  536.                  directory specified by the path \doc and its
  537.                  branches, similar to the Unix -r option.  Use
  538.                  this switch to archive complete directories.
  539.  
  540.         The /r and /r2 switches set the /x switch simultaneously.
  541.         You may have to toggle the /x switch off (with /x-) after
  542.         using /r or /r2.  The /x- switch tells LHarc to disregard
  543.         stored directory names.
  544.  
  545.  
  546.      /w[-|+|<directory_name>] (set Working directory)
  547.  
  548.      LHarc a /w[d:\temp] ARCHIVE.LZH [file1.ext file2.ext ...]
  549.  
  550.         Creates all the temporary files for 'ARCHIVE.LZH' in the
  551.         directory \temp\ on drive D:.  If no directory name is
  552.         specified with this switch, then the current directory
  553.         becomes the working directory and all the temporary files
  554.         created in the process of archiving will reside in this
  555.         directory and be deleted afterward.
  556.  
  557.      Use the /w switch when
  558.  
  559.         (1) you have no room in the directory where the archive is,
  560.             or
  561.         (2) you want your work done silently and swiftly on a RAM
  562.             disk.
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571. LHarc User's Manual                                              page 11
  572.  
  573.  
  574.  
  575.         This switch overrides the working directory that may be
  576.         specified in an environment variable (see below).
  577.  
  578.  
  579.      /v[-|+|2|<utility_name>] (View file by another utility)
  580.  
  581.      LHarc p /v ARCHIVE.LZH file1.ext
  582.  
  583.         Extracts 'file1.ext' from 'ARCHIVE.LZH' and invokes the
  584.         default utility LESS for formatted display to standard
  585.         output.
  586.  
  587.         NOTE:  LESS.COM is an utility similar to MORE.COM of
  588.                MS-DOS and something more, but less than the
  589.                "LESS" of American Unix networks.  PC-LESS.ARC,
  590.                LIST64A.ARC or SEE15.ARC (available from many
  591.                BBS sources in the U.S.A.) work as well as the
  592.                Japanese utility.
  593.  
  594.         LHarc first creates an un-archived file 'LHARC.TMP' and then
  595.         invokes the specified utility, usually a page formatter like
  596.         LIST.EXE or SEE.EXE.  Temporary files will normally be
  597.         deleted after you have viewed their output.
  598.  
  599.      LHarc p /v2 /vbrowse ARCHIVE.LZH file1.ext
  600.  
  601.         Invokes BROWSE.COM for paged display of 'file1.ext' to
  602.         standard output, but suppresses the output of file names or
  603.         path names.  This special '2' option is provided for viewing
  604.         binary files with a dump utility.
  605.  
  606.      /n[-|+] (No Indicator)
  607.  
  608.         Suppress progress display oooo... in the process of
  609.         archiving and de-archiving.  The display is on the standard
  610.         error stream so that the dsiplay is on even in the process
  611.         of redirection.
  612.  
  613.  
  614.     /k<keyword> (Keyword for AUTOLARC.BAT)
  615.  
  616.         When used together with the /x switch to make a "large"
  617.         self-extracting archive (SFX), this switch tells LHarc to
  618.         embed the specified keyword into the .EXE file and then to
  619.         turn on the AUTOLARC.BAT auto-execution feature.  That is,
  620.         if the SFX contains a file named 'AUTOLARC.BAT' (which can
  621.         consist of any sequence of batch commands), this file will
  622.         be executed immediately after all the files are extracted,
  623.         but only if the correct keyword is supplied along with the
  624.         SFX name.
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633. LHarc User's Manual                                              page 12
  634.  
  635.  
  636.  
  637.      LHarc s /x /kon ARCHIVE.LZH
  638.  
  639.         Creates the "large" SFX 'ARCHIVE.EXE' from 'ARCHIVE.LZH'
  640.         and turns on auto-execution of AUTOLARC.BAT, conditional
  641.         upon typing the keyword "on".  Then,
  642.  
  643.      C:\>ARCHIVE
  644.  
  645.         Executes 'ARCHIVE.EXE' and extracts all the files, but does
  646.         not auto-execute AUTOLARC.BAT, whereas
  647.  
  648.      C:>ARCHIVE on
  649.  
  650.         Extracts all the files and immediately executes AUTOLARC.BAT.
  651.  
  652.         Note:  Because DOS ignores case on the command line,
  653.                this keyword cannot be made case sensitive.
  654.  
  655.  
  656.      /t[-|+] (Time Stamp)
  657.  
  658.         Update the time stamps of Archive to the newest file in the
  659.         archive, effective with switches (a,u,m,f,d).
  660.  
  661.      LHarc a /t ARCHIVE.LZH file1.ext
  662.  
  663.         Will set the time stamp of ARCHIVE.LZH to that of file1.ext
  664.         if it has the newest time stamp in ARCHIVE.LZH, otherwise
  665.         ARCHIVE.LZH has the time stamp of command-line execution
  666.         above.
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675. LHarc User's Manual                                              page 13
  676.  
  677.  
  678.  
  679.    Archive name (path name):
  680.    =========================
  681.  
  682.    All the files archived by LHarc have the same format as those
  683.    archived by Larc, except that Larc uses the extension '.LZS'.  If you
  684.    specify a different extension, LHarc will prompt you whether to use
  685.    it with the message "Extension of archive is not '.LZH.' Continue
  686.    processing? [Y/N]".
  687.  
  688.    Wildcards are valid in specified file names with the 'e', 'x', 'p',
  689.    'l', 'v' and 's' commands:
  690.  
  691.      LHarc e *.LZH *.c
  692.  
  693.         Extracts all files with extension .C from all archives in
  694.         the current directory.
  695.  
  696.  
  697.    Home directory name (drive name):
  698.    =================================
  699.  
  700.    If you specify a home directory name, then LHarc will refer to that
  701.    directory as if it is the current directory.  Specify a home
  702.    directory name ending with either '\' or ':'.  All files will be
  703.    archived without storing this directory name unless you also use the
  704.    /r or /x switch.
  705.  
  706.    Example:  Suppose you have the following directory tree:
  707.  
  708.                          |-- BIN --
  709.                          |
  710.         |-- \ --|-- TC --|-- LIB --
  711.                          |
  712.                          |-- INCLUDE --|-- SYS --|-- STAT.H
  713.  
  714.    From the root directory, \,
  715.  
  716.    LHarc a /r ARCHIVE.LZH stat.h tc\include\
  717.  
  718.         adds '\tc\include\sys\stat.h' to 'ARCHIVE.LZH' with the path
  719.         name 'sys\stat.h' from your home directory \tc\include\.
  720.  
  721.  
  722.    File name (path name):
  723.    ======================
  724.  
  725.    The file names or path names of files to be archived must be
  726.    specified or else LHarc will assume *.* with no directory names.
  727.    The wildcards '*' and '?' behave exactly as in DOS.  You cannot use
  728.    them to specify directories except with the /r2 switch, similar to
  729.    the Unix -r option for cp, mv and rm.
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738. LHarc User's Manual                                              page 14
  739.  
  740.  
  741.  
  742.    Switch delimiter:
  743.    =================
  744.  
  745.    If you are currently using some other character, like '-', in place
  746.    of the forward slant '/' as a switch delimiter (from the undocu-
  747.    mented DOS Function 37H, Set/Query Switchar), then you have to use
  748.    your character in place of '/', like "-cx".  This makes '/' available
  749.    as a directory delimiter instead of '\', as in Unix convention.  (You
  750.    can use '-' as a switch delimiter with LHarc anyway.)
  751.  
  752.    The above comment may not apply unless you are running MS-DOS 3.xx.
  753.  
  754.  
  755. 2. Setting Switches in an Environment Variable
  756.  
  757.    You may set any of LHarc's default switches with the environment
  758.    variable 'LHARC':
  759.  
  760.      SET LHARC=/we: /r2
  761.  
  762.         will set drive E: as the working directory and archive all
  763.         files in directory mode.
  764.  
  765.    You may also specify LHarc's working directory with the environment
  766.    variable 'TMP':
  767.  
  768.      SET TMP=E:
  769.  
  770.         but the /w switch will override this setting.
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779. LHarc User's Manual                                              page 15
  780.  
  781.  
  782.  
  783. 3. Self-Extracting Files
  784.  
  785.    LHarc can create a self-extracting archive (SFX), which makes file
  786.    transfers very easy because the recipient does not need to have
  787.    LHarc itself to extract the contents.
  788.  
  789.    There are two models of SFX: "small" and "large." A "small" SFX is
  790.    designed to fit in working memory, but a "large" SFX depends only on
  791.    available disk storage.  When run, each model will sign on with a
  792.    corresponding screen message: "LHarc's SFX 1.13C[S or L]".
  793.  
  794.    On execution, either model SFX looks first for an archived file with
  795.    the name '!' and displays it to the screen followed by the simple
  796.    message "[Y/N]", which is prompting you whether or not to extract the
  797.    rest of the files.  This option, called a telop, is provided for your
  798.    convenience; it might be used for an announcement, an invitation, a
  799.    cover letter for E-mail, a shipping label, an ANSI graphics screen,
  800.    or whatever you please.  Thus, the telop will politely reassure the
  801.    recipient of your SFX as to sender, contents and intentions.  To
  802.    make a telop, simply create a suitable ASCII file with your favorite
  803.    text editor and then rename it to '!' before archiving.
  804.  
  805.    If you create a file with the name 'AUTOLARC.BAT' (which can consist
  806.    of any sequence of batch commands) and include in a "large" SFX, you
  807.    can optionally embed a keyword that will activate auto-execution of
  808.    this batch file immediately after all the files are extracted.
  809.    Otherwise, any AUTOLARC.BAT file will simply be harmlessly extracted
  810.    along with the rest of the files.
  811.  
  812.    It is, of course, possible to smuggle destructive "jokes" or so-
  813.    called viruses into this AUTOLARC.BAT file (a "Trojan horse"). So, to
  814.    guard against such unscrupulous use of this powerful feature of
  815.    LHarc, I have provided a measure of security with the telop and the
  816.    keyword.
  817.  
  818.    The attribute byte of all the extracted files will normally be 20h.
  819.    If you specify /x switch in Large SFX files, then you may restore any
  820.    attributes.  This feature is only for Large model.  A typical command
  821.    line looks like:
  822.  
  823.      ARCHIVE [/kword] [/edirectory_name][/x][/a].
  824.  
  825.    Note:  In MS-DOS2.xx a program has no way to know its filename
  826.           or pathname for its own.  So move the self-extracting
  827.           .EXE file on the very directory where is is going to be
  828.           de-archived.  Then execute.
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837. LHarc User's Manual                                              page 16
  838.  
  839.  
  840.  
  841.    "Small" model:
  842.    ==============
  843.  
  844.    A "small" SFX must fit within the size of your available memory, so
  845.    theoretically it can be as large as DOS' 640K workspace.  In
  846.    practice, however, it should not be much larger than 400K, especially
  847.    when you distribute your program, it is not YOU who extract the file.
  848.    Think of people who may not have a fully memory populated machine.
  849.  
  850.      LHarc s ARCHIVE.LZH
  851.  
  852.         Creates 'ARCHIVE.COM' or 'ARCHIVE.EXE', depending on the
  853.         size of your original archive.  Then,
  854.  
  855.      C:\>ARCHIVE
  856.  
  857.         Displays the telop file '!' on the screen and prompts you
  858.         whether to proceed to extract files, with the simple message
  859.         "[Y/N]" (add your own message to the end of the telop to
  860.         take advantage of this prompt).  The telop itself is not
  861.         extracted; to record it to disk, type
  862.  
  863.      C:\>ARCHIVE >!
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872. LHarc User's Manual                                              page 17
  873.  
  874.  
  875.  
  876.    "Large" model:
  877.    ==============
  878.  
  879.    A "large" SFX is limited in size only by available disk storage and
  880.    will optionally auto-execute an AUTOLARC.BAT file immediately after
  881.    extracting all the files.
  882.  
  883.      LHarc s /x /kon ARCHIVE.LZH
  884.  
  885.         Creates 'ARCHIVE.EXE' (the extension is always .EXE in this
  886.         case) and turns on auto-execution of AUTOLARC.BAT,
  887.         conditional upon typing the keyword "on".
  888.  
  889.    Auto-execution of AUTOLARC.BAT will take place if and only if you
  890.    supply the keyword (case insensitive) along with the SFX name.  For
  891.    the above example,
  892.  
  893.      C:\>ARCHIVE on
  894.  
  895.        or
  896.  
  897.      C:\>ARCHIVE ON
  898.  
  899.         Extracts all the files and immediately executes AUTOLARC.BAT,
  900.         whereas:
  901.  
  902.      C:\>ARCHIVE
  903.  
  904.         Just extracts all the files after displaying the telop, if
  905.         any.
  906.  
  907.         Note:  If a file with the name 'AUTOLARC.BAT' already
  908.                exists in the current directory, it will auto-
  909.                matically be overwritten.
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918. LHarc User's Manual                                              page 18
  919.  
  920.  
  921.  
  922.    Destination directory(s):
  923.    =========================
  924.  
  925.    You can use the /e switch with the SFX name to specify the
  926.    destination directory for all the extracted files, but only for a
  927.    "large" SFX:
  928.  
  929.      C:\>ARCHIVE /ed:\temp
  930.  
  931.         Extracts all the files in 'ARCHIVE.EXE' to the directory \
  932.         temp\ on drive D:.
  933.  
  934.    In addition, if any directory names are stored with the file names
  935.    in the original archive, you can use the /x switch to extract files
  936.    with full path names:
  937.  
  938.      C:\>ARCHIVE /ed: /x
  939.  
  940.         Extracts all the files to drive D: and extends file names
  941.         with directory names.  If any of these directories does not
  942.         exist, then it will be automatically created.  Any
  943.         AUTOLARC.BAT file, however, is always extracted to the
  944.         current directory, whether you use the /x switch or not.
  945.  
  946.  
  947.  
  948.    View Self-extracting files.
  949.    ===========================
  950.  
  951.    From version 1.12b on, you may handle self-extracting .COM or .EXE
  952.    files as .LZH files with commands e, x, p, t, l, v, s.  Please use
  953.    full filename with extension .com or .exe.  Like:
  954.  
  955.      LHarc l ARCHIVE.exe
  956.  
  957.    To take a list of files inside a self-extracting ARCHIVE.exe file.
  958.    Be ALERT to the danger of overwriting or creating a new file with
  959.    the 's' switch.  Try to keep a backup when viewing.
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969. LHarc User's Manual                                              page 19
  970.  
  971.  
  972.  
  973. 4. Archive File Header
  974.  
  975.    LHarc's header is compatible with that of Larc.  Methods of
  976.    archiving are two:
  977.  
  978.      -lh0-   stored as it was and
  979.      -lh1-   compressed by LZHuf coding.
  980.  
  981.    LHarc can also extract files stored in Larc-created archives (with
  982.    the extension .LZS) if they are type 4 or 5.
  983.  
  984.    NOTE:  Larc is another Japanese archiver, with source code
  985.           published in a journal.  It is now also available in the
  986.           United States.  Larc, also, has a SFX self-extractor.
  987.           The structure of self-extracting large SFX file looks
  988.           like:  (SFX + "key word") archived + header + archived
  989.           file.
  990.  
  991.  
  992. 5. Result Codes
  993.  
  994.    LHarc returns the following result codes to the parent process:
  995.  
  996.         0   Normally finished.
  997.  
  998.         1   Process finished with nonexistent file names ignored
  999.             during archiving or CRC error occurred during
  1000.             un-archiving.
  1001.  
  1002.         2   Process terminated by fatal error; no archive created
  1003.             or files moved.
  1004.  
  1005.         3   Unable to write temporary files into the archive.  Work
  1006.             file renamed to 'LHARC.)2(' and original archive
  1007.             deleted.  Try renaming LHARC.)2( as your archive,
  1008.             although it might be damaged.
  1009.  
  1010.  
  1011. 6. Temporary Files
  1012.  
  1013.         LHARC.)1(   Original archive, renamed.
  1014.         LHARC.)2(   Work file used to create new archive.
  1015.         LHARC.TMP   Work file created for viewing by another utility.
  1016.  
  1017.    If a file with one of these file names already exists in the working
  1018.    directory, then the behavior of LHarc is unpredictable.
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027. LHarc User's Manual                                              page 20
  1028.  
  1029.  
  1030.  
  1031. 7. My Distribution Policy
  1032.  
  1033.    Under the following conditions, you may freely copy and distribute
  1034.    this software:
  1035.  
  1036.    1. Under all circumstances, "Copyright by Haruyasu Yoshizaki"
  1037.       must be attached to the copy.
  1038.  
  1039.    2. This manual or its hardcopy should go together with the
  1040.       software.
  1041.  
  1042.    3. You may modify the program, but in that case, you must distri-
  1043.       bute the complete source code for the program, including your
  1044.       specific contributions and you must make it clear that you
  1045.       have made such modifications.
  1046.  
  1047.    4. You must try to distribute the latest version available.
  1048.  
  1049.    5. I assume no warranty for any claim of damage you may sustain
  1050.       by using this software.
  1051.  
  1052.    6. I have no obligation to revise the program to correct any
  1053.       fault in this software.
  1054.  
  1055.    7. For any commercial use of this software, I add the following:
  1056.  
  1057.       a. The entire software made incorporating this program should
  1058.          not be copy protected in the sense that the DISKCOPY
  1059.          program of MS-DOS makes an imperfect copy.
  1060.  
  1061.       b. Every part of the package should print the name "LHarc" and
  1062.          the copyright banner.
  1063.  
  1064.       c. The distribution policy of this software should be printed
  1065.          either in the manual, in the package or on the disk label.
  1066.  
  1067.          Comment:  If a commercial package or a shareware
  1068.                    product uses LHarc with self-extracting SFX
  1069.                    form for the distribution, then the Copy-
  1070.                    right statement must appear with SFX header.
  1071.                    I consider this as a claim of LHarc's Banner.
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080. LHarc User's Manual                                              page 21
  1081.  
  1082.  
  1083.  
  1084. 8. Acknowledgments
  1085.  
  1086.    Special gratitude to Haruhiko Okumura, who uploaded the code for
  1087.    LZari to PC-VAN on which my LZHuf coding is based; and to Kazuhiko
  1088.    Miki, the author of Larc I, who re-posted LZari on Nifty Serve.  To
  1089.    all who contributed reviews, comments and bug reports, I express my
  1090.    thanks.
  1091.  
  1092.    Thanks also to Prof. Kenjirou Okubo who has spent much of his own
  1093.    time in reviewing the English manual and resources in distributing
  1094.    LHarc into the United States.
  1095.  
  1096.    The .EXE file for LHarc is nearly 2K smaller owing to use of
  1097.    pcs27162 by S. Takanami.  I honor this utility and thank him for
  1098.    letting me use it to prepare LHarc.
  1099.  
  1100.    I have made so many revisions to LHarc, yet I do not think I can
  1101.    ever expel all the bugs dwelling inside.  I would appreciate any
  1102.    comments and bug reports.  Please route them to me via the SDR
  1103.    Forum on Nifty Serve or salon.pds of ASCII Net.  In the United
  1104.    States, CompuServe subscribers can contact me through Kenjirou
  1105.    Okubo 74100,2565 or on GEnie via 'K.OKUBO'.
  1106.  
  1107.  
  1108. 9. References
  1109.  
  1110.    1) Labo, A.P., A Hard Disk Cookbook:  Shouei Press (1987).
  1111.  
  1112.    2) Kurita, T., Huffman coding, bit:  Jewelry Box of Computing 43,
  1113.       vol. 20, no. 7, pp. 100-101 (1988).
  1114.  
  1115.    3) Miki, K., Documentation for Larc:  LARC.MAN.
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124. LHarc User's Manual                                              page 22
  1125.  
  1126.  
  1127.  
  1128. 10. History of Revisions
  1129.  
  1130. v1.13c
  1131.     1. Following Mr.Okumura's sugestion, a check is now made for
  1132.        the size of extractable files being added.
  1133.     2. Check size of the specified directory for extraction.
  1134.     3. In using temporary files, LHarc checks the size of available
  1135.        area and in case of shortage, restore in old archives.
  1136.  
  1137. v1.13b
  1138.     1. /t switch to update even if no transaction is made.
  1139.     2. LHarc accepts self-extracting .COM &.EXE files like .LZH
  1140.        files in e, x, p, t, l and s commands.
  1141.     3. Bugs in B: D: drive specification removed.
  1142.  
  1143. v1.13
  1144.     1. New /t switch added
  1145.     2. Display redirected to standard error stream.
  1146.     3. Bugs fixed in large SFX model.
  1147.     4. /a switch in large SFX model.
  1148.     5. Some trial t let a program know its path_name and own name.
  1149.     6. Some mixed dislay when a file_name contains '$'.
  1150.     7. User's Manual rewritten to reflect changes since v1.00.
  1151.  
  1152. v1.12b
  1153.     1. Fixed bug in auto-execution of AUTOLARC.BAT after self-
  1154.        extraction.
  1155.  
  1156. v1.12
  1157.     1. Added 't' command.
  1158.     2. Changed screen display to show new commands and switches.
  1159.     3. Fixed bug in CRC error check with archived file of zero
  1160.        length.
  1161.     4. Revisions to self-extracting archives:
  1162.        - "large" and "small" SFXs
  1163.        - telop file '!'
  1164.        - /k switch for security against Trojan horses
  1165.  
  1166. v1.01
  1167.     1. Minor touchups to help screen and program messages.
  1168.     2. User's Manual rewritten for clarity and intelligibility.
  1169.  
  1170. v1.00
  1171.     1. Mode without work file added.
  1172.     2. /r switch forces /x switch on simultaneously.
  1173.  
  1174. v0.07c
  1175.     1. Removed bug in detecting memory shortage.
  1176.     2. Compacted self-extraction program.
  1177.  
  1178. v0.07a
  1179.     1. Vers. 0.05-0.07 break down heap areas.  Corrected.
  1180.     2. Now accepts any directory name with any attributes.
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189. LHarc User's Manual                                              page 23
  1190.  
  1191.  
  1192.  
  1193. v0.07
  1194.     1. Prohibited actions to a write-protected archive.
  1195.     2. 'm' command now removes files made by older versions.
  1196.     3. Error-handling routine revised in dealing with wildcards for
  1197.        archive names.
  1198.     4. No command specified is now interpreted as 'l' command
  1199.        specified.
  1200.     5. Error level 1 returned when CRC checking detects an error
  1201.        during un-archiving.
  1202.     6. Program now halts when self-extraction process meets an
  1203.        error.
  1204.     7. Bug fixed in CRC checking when a directory name is met in
  1205.        the un-archiving process.
  1206.  
  1207. v0.06b
  1208.     1. Removed possibility of a damaged cluster appearing in failing
  1209.        to re-create (= freshen) an archived file.
  1210.     2. Removed '+' bug in redirecting output with 'p' command.
  1211.  
  1212. v0.06
  1213.     1. If a file transaction fails with 'u', 'm' or 'f' command,
  1214.        LHarc will leave the archive as it was.
  1215.     2. File attributes were sometimes misunderstood by 'f' command.
  1216.        This possibility eliminated.
  1217.  
  1218. v0.05
  1219.  
  1220.     1. CRC checks extended to self-extracting archives.
  1221.     2. Completely recursive modes made possible for 'a,u,m' commands.
  1222.     3. Meets requirements of APPEND.EXE of MS-DOS version 3.3.
  1223.     4. '\' no longer needed at end of working directory name with /w
  1224.        switch.
  1225.  
  1226. v0.04
  1227.     1. Support for environment variable 'TMP'.
  1228.  
  1229.     2. "LHarc p /v a.lzh a_file" used to delete 'a_file' in case of
  1230.        an error.  Bug fixed.
  1231.     3. Added check for a file with the same name in making a self-
  1232.        extracting archive.
  1233.     4. In a self-extracting archive, if a file with the same name
  1234.        of larger size existed, then LHarc kept the difference when
  1235.        it was overwritten by one of smaller size.  This bug removed.
  1236.  
  1237. v0.03
  1238.     1. Environment variable 'LHARC' sets some of the switches.
  1239.     2. Made it possible to specify '+', '-' with switches.
  1240.     3. /v switch included.
  1241.     4. Wildcards can now be used for archive names with 'e,x,p,l,v,s'
  1242.        commands.
  1243.     5. Home directory names had some interactions with Kanji-code.
  1244.        Fixed.
  1245.     6. Fixed header-file bugs of self-extracting .EXE files.
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254. LHarc User's Manual                                              page 24
  1255.  
  1256.  
  1257.  
  1258. v0.02
  1259.     1. Support for 'm' command.
  1260.     2. Larc 3.xx compatibility.  Type 4, 5 .LZS files are un-
  1261.        archived.
  1262.     3. Accommodation to systems with different switch characters.
  1263.     4. Minor bugs fixed with 'e' command.
  1264.     5. Revised format for 'l' command.
  1265.  
  1266. v0.01
  1267.     1. Support for self-extracting archives.
  1268.     2. 'p' command added.
  1269.     3. /c switch applies to more combinations of commands and
  1270.        switches.
  1271.     4. Error handling revised.
  1272.     5. Bug fixed in 'l' command.
  1273.     6. New algorithm introduced in sorting path names.
  1274.  
  1275.  
  1276.  
  1277. 11. Comments
  1278.  
  1279.  a. Some other algorithms I have in mind.
  1280.  
  1281.     With some specific files, the compression ratios are not as good as
  1282.     with PKware's PKZIP.  For such files, I may use LZSS compression
  1283.     with correlated arithmetic compression.  This is an effective
  1284.     method and my experiments show that the ratios are no less than
  1285.     PKware's.  Yet it takes too much time in both the archiving and
  1286.     un-archiving processes, with much higher memory consumption.
  1287.     Consequently, I intend to keep working on the LZHuf algorithm.
  1288.  
  1289.     Naturally, I am ready to receive any comments and I continue to
  1290.     experiment.
  1291.  
  1292.  
  1293.  b. Naming of LHarc
  1294.  
  1295.     Some people have expressed concern over the fact that the string
  1296.     "arc" is contained in the name "LHarc." I make the following
  1297.     statements just for them.
  1298.  
  1299.     The crucial points in SEA's suit against PKware were the way in
  1300.     which PKware advertised and sold PK(x)arc with an emphasis on its
  1301.     ARC compatibility and the loss of profits from shareware
  1302.     contributions.
  1303.  
  1304.     This is not the case with LHarc.  I have used a different archiving
  1305.     method and made it a free program with a format incompatible with
  1306.     ARC.  I hope I will not be bothered by similar accusations.
  1307.  
  1308.                                   - end -
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. -
  1320.